package com.backend.mzyf.Utils;

import sun.misc.BASE64Encoder;

import java.util.Date;
import java.util.UUID;

public class Security {

    public String generaCsrfToken()
    {
        String token = null;
        BASE64Encoder base64Encoder = new BASE64Encoder();
        String timeStamp = Long.toString(new Date().getTime());
        token = new MD5().MD5((UUID.randomUUID().toString())+timeStamp);
        token = base64Encoder.encode(token.getBytes());

        return token;
    }

}
